package tdh.xt.filter;

import org.springframework.web.filter.OncePerRequestFilter;
import tdh.xt.entity.MyRequest;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Package com.xt.filter
 * @Description 把GET请求中的url参数解码类
 * @Author Ricardo
 * @Date 2021/5/10 2:33
 * @Copyright (c) 2021,南京通达海科技股份有限公司 All Rights Reserved.
 * @Version 1.0
 * Modification History:
 * Date                  Author      Version     Description
 * ------------------------------------------------------------------
 * 2021/5/10 2:33       Ricardo       1.0    把GET请求中的url参数解码类
 */
public class DecodeFilter extends OncePerRequestFilter {

    /**
     * @param request   req
     * @param response  resp
     * @param filterChain chain
     * @description 执行过滤器
     * @author RicarAN
     * @date 2021/5/10 2:34
     * @version 1.0
     */
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
                                    FilterChain filterChain) throws ServletException, IOException {
        MyRequest myRequest = new MyRequest(request);
        filterChain.doFilter(myRequest, response);
    }

}
